import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/login'    //重定向
  },
  {
    path: '/main',
    name: 'Main',
    component: () => import(/* webpackChunkName: "about" */ '../views/Main.vue'),
    children:[
      {
        path:'/welcome',
        name:'Welcome',
        component: () => import(/* webpackChunkName: "about" */ '../views/welcome/Welcome.vue'),
      },
      {
        path:'/users',
        name:'User',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/Users.vue'),
      },
      {
        path:'/menuPermissions',
        name:'MenuPermissions',
        component: () => import(/* webpackChunkName: "about" */ '../views/menu/MenuPermissions.vue'),
      }
    ]

  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
